<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/4/14 0014
 * Time: 下午 14:03
 */

namespace Home\Model;
use Think\Model;

class ReceiverMsgModel extends Model{
    //获取当前客户和客服的聊天信息
    public function get_msg($userid,$receiverid){
        $receiver = D()->query("select * from receiver_msg where send_id='{$userid}' and receiver_id='{$receiverid}'");
        $send = D()->query("select * from send_msg where send_id='{$receiverid}' and receiver_id='{$userid}'");
        $arr = array_merge($send,$receiver);
        $time = array_column($arr,'time');
        array_multisort($time,$arr);
        return $arr;
    }
}